import config from "./config";
import { Module } from "@nestjs/common";
import { ConfigModule } from "@nestjs/config";
import { AppController } from "./app.controller";
import { AppService } from "./app.service";
import { CommonModule } from "./modules/common/common.module";
import { BooksModule } from "./modules/books/books.module";
import { UserModule } from "./modules/user/user.module";
import { KnowledgeGraphModule } from "./modules/knowledgeGraph/knowledgeGraph.module";
import { RecommendModule } from "./modules/recommend/recommend.module";


@Module({
  imports: [

    /* 全局配置文件 之后可以在任意地方使用ConfigService读取配置 */
    ConfigModule.forRoot({
      isGlobal: true,
      load: [config]
    }),

    /* 公共模块 */
    CommonModule,

    /* 业务模块 */
    BooksModule,
    UserModule,
    KnowledgeGraphModule,
    RecommendModule
  ],
  controllers: [AppController],
  providers: [AppService]
})
export class AppModule {
}
